package com.ruoyi.web.controller.rabbit;


import com.rabbitmq.client.Channel;
import com.rabbitmq.client.impl.AMQImpl;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;



@Component
public class Cousumer {
    @RabbitListener(queues="car")
    public void process(Message message, Channel channel) throws Exception{
        channel.basicAck(message.getMessageProperties().getDeliveryTag(),true);
        System.out.println("receive:"+new String(message.getBody()));
    }
}
